/**
 * 
 */
package de.cbf.cam.dsa.dataprovider.weapons;

import java.util.ArrayList;
import java.util.List;

import de.cbf.cam.dsa.model.entities.WeaponStyle;
import de.cbf.cam.dsa.model.entities.constants.WeaponStyleTemplates;
import de.cbf.cam.dsa.model.entities.weapon.OneWeapon;
import de.cbf.cam.dsa.model.entities.weapon.WeaponMelee;
import de.cbf.cam.dsa.model.entities.weapon.WeaponRanged;
import de.cbf.cam.dsa.model.interfaces.IDataProviderWeapons;

/**
 * @author Nebelritter
 *
 */
public class DataProviderWeapons implements IDataProviderWeapons {

	private final String name = "WeaponBaseProvider";

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.model.interfaces.IDataProviderWeapons#getName()
	 */
	@Override
	public String getName() {		
		return name;
	}

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.model.interfaces.IDataProviderWeapons#provideWeapons()
	 */
	@Override
	public List<OneWeapon> provideWeapons() {
		List<OneWeapon> allWeapons = new ArrayList<OneWeapon>();
		
		List<WeaponMelee> meleeWeapons = new ArrayList<WeaponMelee>();
		meleeWeapons.addAll( ProviderDaggers		.getInstance().provideDaggers());
		meleeWeapons.addAll( ProviderBatons			.getInstance().provideBatons());
		meleeWeapons.addAll( ProviderFencingWeapons .getInstance().provideFencingWeapons());
		meleeWeapons.addAll( ProviderSabre 			.getInstance().provideSabres());	
		meleeWeapons.addAll( ProviderStaffs			.getInstance().provideStaffs());
		meleeWeapons.addAll( ProviderSpears			.getInstance().provideSpears());
		meleeWeapons.addAll( ProviderSwords			.getInstance().provideSwords());
		meleeWeapons.addAll( ProviderTwoHandBatons	.getInstance().provideTwoHandBatons());
		
		List<WeaponRanged> rangedWeapons = new ArrayList<WeaponRanged>();
		
		
		allWeapons.addAll(meleeWeapons);
		allWeapons.addAll(rangedWeapons);
		
		allWeapons.add(provideAllWeapon());
		
		return allWeapons;
	}
	private WeaponMelee provideAllWeapon(){
		WeaponMelee weapon =new WeaponMelee();
		weapon.setWeaponType("AllWeaponTest");		
		weapon.setTpDiceNumber(4);
		weapon.setTpDiceSides(6);
		weapon.setTpBonus(4);		
		weapon.setKKTreshold(12);
		weapon.setKKStep(2);		
		weapon.setWeight(50);
		weapon.setWeapLength(60);		
		weapon.setBf(-2);		
		weapon.setIniMod(2);		
		weapon.setPrice(90);		
		weapon.setWmAT(-1);
		weapon.setWmPA(1);
		weapon.setDkBits(WeaponMelee.DKH|WeaponMelee.DKN|WeaponMelee.DKS|WeaponMelee.DKP);	
		weapon.setWear("");
		//weapon styles
		WeaponStyle style = WeaponStyleTemplates.provideAnderthalbhaender();
		style.setName("AllStyle");
		
		weapon.addStyle(style);
		return weapon;
	}
}
